<!doctype html>
<html>
  <head>
    <!-- MathJax -->
    <script type="text/javascript"
      src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
    </script>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <title>
      Caffe | Web demo
    </title>

    <link rel="icon" type="image/png" href="/images/caffeine-icon.png">

    <link rel="stylesheet" href="/stylesheets/reset.css">
    <link rel="stylesheet" href="/stylesheets/styles.css">
    <link rel="stylesheet" href="/stylesheets/pygment_trac.css">

    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <!--[if lt IE 9]>
    <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
  </head>
  <body>
  <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-46255508-1', 'daggerfs.com');
    ga('send', 'pageview');
  </script>
    <div class="wrapper">
      <header>
        <h1 class="header"><a href="/">Caffe</a></h1>
        <p class="header">
          Deep learning framework by <a class="header name" href="http://bair.berkeley.edu/">BAIR</a>
        </p>
        <p class="header">
          Created by
          <br>
          <a class="header name" href="http://daggerfs.com/">Yangqing Jia</a>
          <br>
          Lead Developer
          <br>
          <a class="header name" href="http://imaginarynumber.net/">Evan Shelhamer</a>
        <ul>
          <li>
            <a class="buttons github" href="https://github.com/BVLC/caffe">View On GitHub</a>
          </li>
        </ul>
      </header>
      <section>

      <h1 id="web-demo">Web Demo</h1>

<h2 id="requirements">Requirements</h2>

<p>The demo server requires Python with some dependencies.
To make sure you have the dependencies, please run <code class="highlighter-rouge">pip install -r examples/web_demo/requirements.txt</code>, and also make sure that you’ve compiled the Python Caffe interface and that it is on your <code class="highlighter-rouge">PYTHONPATH</code> (see <a href="/installation.html">installation instructions</a>).</p>

<p>Make sure that you have obtained the Reference CaffeNet Model and the ImageNet Auxiliary Data:</p>

<div class="highlighter-rouge"><pre class="highlight"><code>./scripts/download_model_binary.py models/bvlc_reference_caffenet
./data/ilsvrc12/get_ilsvrc_aux.sh
</code></pre>
</div>

<p>NOTE: if you run into trouble, try re-downloading the auxiliary files.</p>

<h2 id="run">Run</h2>

<p>Running <code class="highlighter-rouge">python examples/web_demo/app.py</code> will bring up the demo server, accessible at <code class="highlighter-rouge">http://0.0.0.0:5000</code>.
You can enable debug mode of the web server, or switch to a different port:</p>

<div class="highlighter-rouge"><pre class="highlight"><code>% python examples/web_demo/app.py -h
Usage: app.py [options]

Options:
  -h, --help            show this help message and exit
  -d, --debug           enable debug mode
  -p PORT, --port=PORT  which port to serve content on
</code></pre>
</div>

<h2 id="how-are-the-maximally-accurate-results-generated">How are the “maximally accurate” results generated?</h2>

<p>In a nutshell: ImageNet predictions are made at the leaf nodes, but the organization of the project allows leaf nodes to be united via more general parent nodes, with ‘entity’ at the very top.
To give “maximally accurate” results, we “back off” from maximally specific predictions to maintain a high accuracy.
The <code class="highlighter-rouge">bet_file</code> that is loaded in the demo provides the graph structure and names of all relevant ImageNet nodes as well as measures of information gain between them.
Please see the “Hedging your bets” paper from <a href="http://www.image-net.org/projects/hedging/">CVPR 2012</a> for further information.</p>


      </section>
  </div>
  </body>
</html>
